﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace YourStore.Models
{
    [MetadataType(typeof(ProductMetaData))]
    public partial class Category
    {
        // Validation rules for the product class

        [Bind(Exclude = "ProductId")]
        public class ProductMetaData
        {
            [ScaffoldColumn(false)]
            public object ProductId { get; set; }

            [DisplayName("Category")]
            public object CategoryId { get; set; }

             [Required(ErrorMessage = "An Product Name is required")]
            [DisplayName("Name")]
            public object Name { get; set; }

           [DisplayName("Description")]
            public object Description { get; set; }
            
            [DisplayName("Image")]
            [StringLength(1024)]
            public object Image { get; set; }

            public object Deleted { get; set; }

            public object CreatedOn { get; set; }
            public object UpdatedOn { get; set; }
            public object DisplayOnHome { get; set; }
            public object RelatedProduct { get; set; }


            [Required(ErrorMessage = "Price is required")]
            [Range(50.00, 1000.00, 
                ErrorMessage = "Price must be between 0.01 and 100.00")]
            public object Price { get; set; }
        }
    }
}